<div class="frame_right_table">
	<?php echo CHtml::form(CHtml::normalizeUrl(array("announce/list")),$method='get',array('id'=>'formsearch'));?>
	<div class="userListForm">
		公告内容：<input type="text" name="keyword" size="9">
				<?php echo CHtml::submitButton('查询',array('class'=>'frame_bt_1','id'=>'search')); ?>
	</div>
	<?php echo CHtml::endForm();?>
	<form name="list_form" id="list_form" method="post" action="<?php echo CHtml::normalizeUrl(array('announce/delete'));?>">
	<table class="tableContent" width="100%" cellspacing="0" cellpadding="0">
		<thead>
		<tr>
			<th width='20px'  title="全选"><?php echo CHtml::CheckBox('checkall')?></th>
			<th width="40px" id='id'>ID</span></th>
			<th >主题</th>
			<th width="130px" id='create_time'>创建时间</th>
			<th width="120px">排序</th>
			<th width="130px" >操作</th>
		
		</tr>
		</thead>
		<tbody>
		<?php
			for($i=0; $i<count($list); $i++)
			{				
		?>
			<tr onMouseOver="this.className='overTD'" onMouseOut="this.className=''">
			<?php
				$checkbox = CHtml::CheckBox('id[]',false,array('value'=>$list[$i]['id']));
				echo CHtml::tag('td',array('style'=>'text-align:center;'),$checkbox);
				echo CHtml::tag('td',array('style'=>'text-align:center;'),$list[$i]['id']);
				echo CHtml::tag('td',array('style'=>'text-align:center;'),$list[$i]['subject']);
			?>
			<?php echo CHtml::tag('td',array('style'=>'text-align:center;'),date("Y-m-d H:i:s",$list[$i]['create_time']));?>
			<td style="text-align:center">
				<input type="hidden" name="ids[]" value="<?php echo $list[$i]['id']; ?>">
				<input type="text" name="sort[]" value="<?php echo $list[$i]['sort']; ?>" style="width:50px; text-align:center">
			</td>
			<td>
			<?php
				echo CHtml::Link('详情',CHtml::normalizeUrl(array('announce/detail','id'=>$list[$i]['id'])),array('class'=>'link_space'));
			?>
			<?php
				echo CHtml::Link('编辑',CHtml::normalizeUrl(array('announce/edit','id'=>$list[$i]['id'])),array('class'=>'link_space'));
			?>
			<?php
				echo CHtml::Link('删除',CHtml::normalizeUrl(array('announce/delete','id'=>$list[$i]['id'])),array('onClick'=>'return Form.confirmurl()','class'=>'link_space'));
			?>
			</td>
			</tr>
		<?php 
			}
		?>
		</tbody>
	</table>
	<div class="myclear"></div>
	<div class="list_page_1">
		<div style="float:left;">
			<?php echo CHtml::submitButton('删除已选项',array('class'=>'frame_bt_1','onclick'=>'return Form.confirmurl("","确定要删除选中项吗？")'))?>
			<input type="button" onclick="doSort()" value="排序" class="frame_bt_1">
			<input type="hidden" value="option_type" id="option_type" value="0">
		</div>
		</form>
		<a class='frame_bt_1' href="<?php echo CHtml::normalizeUrl(array('announce/list','pages'=>1));?>"><input type="button" value="首页"></input></a>
		<a href="<?php echo CHtml::normalizeUrl(array('announce/list','pages'=>$pages));?>"><input type="button" value="<?php echo $pages?>"></input></a>
		<?php  if(($pages+1)<=($maxpages)):?>
		<a href="<?php echo CHtml::normalizeUrl(array('announce/list','pages'=>$pages+1));?>"><input type="button" value="下一页"></input></a>
		<?php endif;?>
		<a href="<?php echo CHtml::normalizeUrl(array('announce/list','pages'=>$maxpages));?>"><input type="button" value="尾页"></input></a>
	</div>
</div>
<script language="javascript" type="text/javascript">
	$(document).ready(function(){
		Load.admin_announce_list();
	});
	
	function doSort()
	{
		$("#option_type").val(1);
		$("#list_form").attr('action','<?php echo CHtml::normalizeUrl(array('announce/sort'));?>');
		document.list_form.submit();
	}
</script>